home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
c
/
bitstrg.zip
/
CLEARBIT.C
< prev
next >
Wrap
C/C++ Source or Header
|
1989-06-01
|
458b
|
30 lines
/*
librairie : bitstrg
clearbit -- mise a 0l d'un bit
*/
#include "bitstrg.h"
/*
Clear specified bit
if bit > map size, 0 is returned, else 1 is returned
*/
unsigned clearbit(ptr,bit)
struct SPARRAY * ptr; /* pointer on structure */
unsigned bit; /* bit number */
{
if(ptr->numlbit < bit) {
return(0);
}
/* AND original with 0 */
(ptr->pntarray)[bit / SIZE] &= ~(1 << (bit & (SIZE - 1)));
return(1);
}